//
//  HomeTransforOrderInfoSecondOneTableViewCell.m
//  ZJControlsClass
//
//  Created by mac on 2024/12/4.
//

#import "HomeTransforOrderInfoSecondOneTableViewCell.h"

@interface HomeTransforOrderInfoSecondOneTableViewCell ()


@property (nonatomic,strong) UILabel * titleLabel;
@property (nonatomic,strong) UILabel * areaLabel;
@property (nonatomic,strong) UILabel * showAreaLabel;
@property (nonatomic,strong) UIView * v;
@property (nonatomic,strong) UILabel * goodsLabel;
@property (nonatomic,strong) UILabel * showGoodsLabel;
@property (nonatomic,strong) UIView * goodsV;
@property (nonatomic,strong) UILabel * timeLabel;
@property (nonatomic,strong) UILabel * showTimeLabel;
@property (nonatomic,strong) UIView * TimeV;



@end




@implementation HomeTransforOrderInfoSecondOneTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self configUI];
        
        
    }
    return self;
    
}


-(void)setModel:(HomeTransforOrderInfoModel *)model{
    _model = model;
    self.showAreaLabel.text = model.area;
    self.showGoodsLabel.text = model.type;
    self.showTimeLabel.text = [NSString stringWithFormat:@"%@-%@",model.startTime,model.endTime];
}



-(void)configUI{
    
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.areaLabel];
    [self.contentView addSubview:self.showAreaLabel];
    [self.contentView addSubview:self.v];
    [self.contentView addSubview:self.goodsLabel];
    [self.contentView addSubview:self.showGoodsLabel];
    [self.contentView addSubview:self.goodsV];
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.showTimeLabel];
    [self.contentView addSubview:self.TimeV];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).with.offset(ALIGN_WIDTH_PT(12));
        make.top.equalTo(self.contentView).with.offset(ALIGN_HEIGHT_PT(10));
    }];
    
    [self.areaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.top.equalTo(self.titleLabel.mas_bottom);
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(120), ALIGN_HEIGHT_PT(49))));
    }];
    
    [self.showAreaLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).with.offset(-ALIGN_WIDTH_PT(12));
        make.centerY.equalTo(self.areaLabel.mas_centerY);
        make.left.equalTo(self.areaLabel.mas_right);
        make.height.equalTo(@(ALIGN_HEIGHT_PT(49)));
    }];
    
    [self.v mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.right.equalTo(self.showAreaLabel.mas_right);
        make.top.equalTo(self.showAreaLabel.mas_bottom);
        make.height.equalTo(@(1));
    }];
    
    [self.goodsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.top.equalTo(self.v.mas_bottom);
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(120), ALIGN_HEIGHT_PT(49))));
    }];
    
    [self.showGoodsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).with.offset(-ALIGN_WIDTH_PT(12));
        make.centerY.equalTo(self.goodsLabel.mas_centerY);
        make.left.equalTo(self.goodsLabel.mas_right);
        make.height.equalTo(@(ALIGN_HEIGHT_PT(49)));
    }];
    
    [self.goodsV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.right.equalTo(self.showGoodsLabel.mas_right);
        make.top.equalTo(self.showGoodsLabel.mas_bottom);
        make.height.equalTo(@(1));
    }];
    
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.top.equalTo(self.goodsV.mas_bottom);
        make.size.equalTo(@(CGSizeMake(ALIGN_WIDTH_PT(120), ALIGN_HEIGHT_PT(49))));
    }];
    
    [self.showTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).with.offset(-ALIGN_WIDTH_PT(12));
        make.centerY.equalTo(self.timeLabel.mas_centerY);
        make.left.equalTo(self.timeLabel.mas_right);
        make.height.equalTo(@(ALIGN_HEIGHT_PT(49)));
    }];
    
    [self.TimeV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleLabel.mas_left);
        make.right.equalTo(self.showGoodsLabel.mas_right);
        make.top.equalTo(self.showTimeLabel.mas_bottom);
        make.height.equalTo(@(1));
    }];
    
    
    
    
    
}


#pragma mark -- 懒加载
-(UILabel *)titleLabel{
    if (!_titleLabel){
        _titleLabel = [UILabel new];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.font = [UIFont systemFontOfSize:16 weight:0.5];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.text = @"基础信息";
    }
    return _titleLabel;
}

-(UILabel *)areaLabel{
    if (!_areaLabel){
        _areaLabel = [UILabel new];
        _areaLabel.textColor = COLOR_RGB(153, 153, 153);
        _areaLabel.font = FONT14;
        _areaLabel.textAlignment = NSTextAlignmentLeft;
        _areaLabel.text = @"通行区域";
    }
    return _areaLabel;
}

-(UILabel *)showAreaLabel{
    if (!_showAreaLabel){
        _showAreaLabel = [UILabel new];
        _showAreaLabel.textColor = [UIColor blackColor];
        _showAreaLabel.font = FONT14;
        _showAreaLabel.textAlignment = NSTextAlignmentRight;
    }
    return _showAreaLabel;
}

-(UIView *)v{
    if (!_v){
        _v = [UIView new];
        _v.backgroundColor = COLOR_RGB(225, 225, 225);
    }
    return _v;
}

-(UILabel *)goodsLabel{
    if (!_goodsLabel){
        _goodsLabel = [UILabel new];
        _goodsLabel.textColor = COLOR_RGB(153, 153, 153);
        _goodsLabel.font = FONT14;
        _goodsLabel.text = @"携带物品";
        _goodsLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _goodsLabel;
}

-(UILabel *)showGoodsLabel{
    if (!_showGoodsLabel){
        _showGoodsLabel = [UILabel new];
        _showGoodsLabel.textColor = [UIColor blackColor];
        _showGoodsLabel.font = FONT14;
        _showGoodsLabel.textAlignment = NSTextAlignmentRight;
    }
    return _showGoodsLabel;
}

-(UIView *)goodsV{
    if (!_goodsV){
        _goodsV = [UIView new];
        _goodsV.backgroundColor = COLOR_RGB(225, 225, 225);
    }
    return _goodsV;
}


-(UILabel *)timeLabel{
    if (!_timeLabel){
        _timeLabel = [UILabel new];
        _timeLabel.textColor = COLOR_RGB(153, 153, 153);
        _timeLabel.font = FONT14;
        _timeLabel.textAlignment = NSTextAlignmentLeft;
        _timeLabel.text = @"有效时间";
    }
    return _timeLabel;
}

-(UILabel *)showTimeLabel{
    if (!_showTimeLabel){
        _showTimeLabel = [UILabel new];
        _showTimeLabel.textColor = [UIColor blackColor];
        _showTimeLabel.font = FONT14;
        _showTimeLabel.textAlignment = NSTextAlignmentRight;
    }
    return _showTimeLabel;
}

-(UIView *)TimeV{
    if (!_TimeV){
        _TimeV = [UIView new];
        _TimeV.backgroundColor = COLOR_RGB(225, 225, 225);
    }
    return _TimeV;
}



@end
